from functools import wraps


# def welcome(fun):
#     @wraps(fun)
#     def wrapper(*args, **kwargs):
#         print("Welcome")
#         result = fun(*args, **kwargs)
#         return result
#     return wrapper


def welcome(name):
    def decorator(fun):
        @wraps(fun)
        def wrapper(*args, **kwargs):
            print(f"Welcome {name}")
            result = fun(*args, **kwargs)
            return result

        return wrapper

    return decorator


@welcome("jerry")
def my_fun(message: str):
    print(f"hello {message}")
# @welcome
# def my_fun(message: str):
#     print(f"hello {message}")


if __name__ == '__main__':
    # f1 = welcome(my_fun)  # f1 => wrapper
    # f1("jack")  # => wrapper("jack")
    my_fun("jack")
    print(my_fun)
    print(my_fun.__name__)
